#include "common.h"

ListNode* reverseList(ListNode* head)
{
	if (head == nullptr || head->next == nullptr)
	{
		return head;
	}

	ListNode* hd = reverseList(head->next);
	head->next->next = head;
	head->next = NULL;
	return hd;
}